package com.stone.starter.core.interceptor;

import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 拦截器链使用示例
 *
 * @author Mr_wenpan@163.com 2021/11/30 1:57 下午
 */
@Order(0)
@Component
public class UserInterceptorChainConfigurer implements InterceptorChainConfigurer<SecurityProperties.User, InterceptorChainBuilder<SecurityProperties.User>> {

    @Override
    public void configure(InterceptorChainBuilder<SecurityProperties.User> builder) {
//        builder
//                .selectChain(InterceptorOperation.CREATE_USER)
//                .pre()
//                .addInterceptor(ValidationInterceptor.class)
//                .post()
//                .async()
//                .addInterceptor(CommonMemberRoleInterceptor.class)
//                .addInterceptor(UserConfigInterceptor.class)
//                .addInterceptor(SendMessageInterceptor.class)
//                .addInterceptor(LastHandlerInterceptor.class);
//
//        builder
//                .selectChain(UserOperation.IMPORT_USER)
//                .post()
//                .addInterceptor(InternalMemberRoleInterceptor.class)
//                .addInterceptor(UserConfigInterceptor.class)
//                .addInterceptor(LastHandlerInterceptor.class);
    }
}